<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/jsp/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title><#noparse>${appname}</#noparse></title>
<%@ include file="/WEB-INF/view/jsp/common/css_js_ace.jsp"%>
<script type="text/javascript">
$(function(){
	$('#inputForm input').tooltip();
	$('#inputForm').checkForm();
    $('#inputForm').ajaxForm({ 
        type: "post",
        dataType:"json",
        beforeSubmit: function(){
	       $("#sbmBtn").attr("disabled","disabled");
        },
        clearForm: false,
        resetForm: false,
        success: function(resp){
        	
        	if(resp.success == '1' ){
        		ui.msg(resp.msg, 1);
        		ui.go(_ctx + '/${moduleUri}/${beanUri}_list');
        	}else{
        		ui.msg(resp.msg, 0);
        		$("#sbmBtn").removeClass("disabled").attr("disabled",null);
        	}
        },
        error:function(resp){
        	ui.msg('请求发送失败', 0);
    		$("#sbmBtn").removeClass("disabled").attr("disabled",null);
        }
    }); 
});
</script>
</head>
<body>
<%@ include file="/WEB-INF/view/jsp/common/admin_topbar.jsp"%>
<div class="main-container" id="main-container">
	<div class="main-container-inner">
		<%@ include file="/WEB-INF/view/jsp/common/admin_sidebar.jsp"%>
		<div class="main-content">
			<div class="breadcrumbs" id="breadcrumbs">
				<ul class="breadcrumb">
					<li>
						<i class="icon-home home-icon"></i>
						<a href="#">首页</a>
					</li>

					<li class="active">控制台</li>
				</ul>
			</div>

			<div class="page-content">
				<div class="row">
					<div class="col-xs-12">
						<div class="widget-box">
							<div class="widget-header widget-header-flat">
								<h5 class="smaller lighter">
									<i class="icon-edit"></i> &nbsp;
								</h5>
								<div class="widget-toolbar no-border">
									<a class="btn btn-primary btn-xs" href="<#noparse>${ctx}</#noparse>/${moduleUri}/${beanUri}_list"><i class="icon-arrow-left"></i> 返回&nbsp;&nbsp;</a>
								</div>
							</div>
							<div class="widget-body">
								<div class="widget-main">
									<form class="form-horizontal" role="form" id="inputForm" action="<#noparse>${ctx}</#noparse>/${moduleUri}/${beanUri}_form" method="post">
										<input type="hidden" name="id" value="<#noparse>${vo.id}</#noparse>"/>	
										
										<#list formColList as vo>
										<#if (vo.name != 'id' && vo.name != 'created' && vo.name != 'modified' && vo.show && vo.name != 'cuid' && vo.name != 'muid')>
										<div class="form-group">
											<label class="col-sm-3 control-label no-padding-right">${vo.nameCN} <#if vo.validate>*</#if></label>
											<div class="col-sm-9">
											<#if 'input' == vo.formType>
												 <#if vo.validate && vo.ajaxCheck>
												 <input type="text" class="col-xs-10 col-sm-5" 
													name="${vo.name}" id="${vo.name}" 
													value="<#noparse>${vo.</#noparse>${vo.name}<#noparse>}</#noparse>"  oldValue="<#noparse>${vo.</#noparse>${vo.name}<#noparse>}</#noparse>"  
													require="true" datatype="require|ajax" msg="请输入${vo.nameCN}|已经被占用" title="必填项"
													url="<#noparse>${ctx}</#noparse>/${moduleUri}/${beanUri}_${vo.name}"/>
												 <#elseif vo.validate>
												 <input type="text" class="col-xs-10 col-sm-5" 
													value="<#noparse>${vo.</#noparse>${vo.name}<#noparse>}</#noparse>"  name="${vo.name}" id="${vo.name}" 
													require="true" datatype="require" msg="请输入${vo.nameCN}" title="必填项"/>
												 <#else>
												 <input type="text" class="col-xs-10 col-sm-5" 
													value="<#noparse>${vo.</#noparse>${vo.name}<#noparse>}</#noparse>"  name="${vo.name}" id="${vo.name}"/>
												 </#if>
											</#if>
											<#if 'textarea' == vo.formType>
												 <#if vo.validate && vo.ajaxCheck>
												 <textarea class="col-xs-10 col-sm-5" name="${vo.name}" id="${vo.name}" 
													require="true|ajax" datatype="require" msg="请输入${vo.nameCN}|已经被占用" title="必填项"
													url="<#noparse>${ctx}</#noparse>/${moduleUri}/${beanUri}_${vo.name}"><#noparse>${vo.</#noparse>${vo.name}<#noparse>}</#noparse></textarea>
												 <#elseif vo.validate>
												 <textarea class="col-xs-10 col-sm-5" name="${vo.name}" id="${vo.name}" 
													require="true" datatype="require" msg="请输入${vo.nameCN}" title="必填项"><#noparse>${vo.</#noparse>${vo.name}<#noparse>}</#noparse></textarea>
												 <#else>
												 <textarea class="col-xs-10 col-sm-5" name="${vo.name}" id="${vo.name}"><#noparse>${vo.</#noparse>${vo.name}<#noparse>}</#noparse></textarea>
												 </#if>
											</#if>
											<#if 'select' == vo.formType>
												 <#if vo.validate && vo.ajaxCheck>
												 <select name="${vo.name}" id="${vo.name}"  
													datatype="require|ajax" msg="请输入${vo.nameCN}|已经被占用" title="必填项"
													oldValue="<#noparse>${vo.</#noparse>${vo.name}<#noparse>}</#noparse>"  
													url="<#noparse>${ctx}</#noparse>/${moduleUri}/${beanUri}_${vo.name}"
													class="col-xs-10 col-sm-5">
													<option value="" >--请选择--</option>
													<#list vo.optionMap?keys as key> 
													<option value="${key}" <c:if test="<#noparse>${</#noparse> '${key}' == vo.${vo.name}<#noparse>}</#noparse>">selected</c:if>>${vo.optionMap[key]}</option>
													</#list>
												 </select>
												 <#elseif vo.validate>
												 <select name="${vo.name}" id="${vo.name}"  datatype="require" msg="必选项"  class="col-xs-10 col-sm-5">
													<option value="" >--请选择--</option>
													<#list vo.optionMap?keys as key> 
													<option value="${key}" <c:if test="<#noparse>${</#noparse> '${key}' == vo.${vo.name}<#noparse>}</#noparse>">selected</c:if>>${vo.optionMap[key]}</option>
													</#list>
												 </select>
												 <#else>
												 <select name="${vo.name}" id="${vo.name}"  class="col-xs-10 col-sm-5">
													<option value="" >--请选择--</option>
													<#list vo.optionMap?keys as key> 
													<option value="${key}" <c:if test="<#noparse>${</#noparse> '${key}' == vo.${vo.name}<#noparse>}</#noparse>">selected</c:if>>${vo.optionMap[key]}</option>
													</#list>
												 </select>
												 </#if>
											</#if>
											</div>
										</div>
										
										<div class="space-4"></div>
										</#if>
										</#list>
										
										<div class="clearfix form-group">
											<div class="col-md-offset-3 col-md-9">
											<button type="submit" class="btn btn-sm btn-info" id="sbmBtn"><i class="icon-ok bigger-110"></i>提交</button>
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
</html>